﻿using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using WcMatch.Attributes;
using WcMatch.Utility;

namespace WcMatch.Models
{
    public class Job
    {
        //招聘需求编号
        [Key]
        [OnlyServerUpdate]
        public string? Id { get; set; }
        //岗位名称
        [AutoValueSet]
        public string? Name { get; set; }
        [AutoValueSet]
        public string? CollegeRequirement { get;set; }
        [AutoValueSet]
        public string? MajorRequirement { get;set; }
        [AutoValueSet]
        public string? DegreeRequirement { get; set; }
        
        public string? MoreRequirement { get; set; }
        [AutoValueSet]
        public int Headcount { get; set; }
        //最低工资,元
        [AutoValueSet]
        public int MinWage { get; set; }
        [AutoValueSet]
        public int MaxWage { get; set; }
        [AutoValueSet]
        public string? Phone { get; set; }

        //其他说明
        public string? Description { get; set; }

        //岗位有效截止日期
        [AutoValueSet]
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? ExpiryDate { get; set;   }

        [OnlyServerUpdate]
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? UpdateTime { get; set; }

        //发布招聘信息的企业名称
        [AutoValueSet]
        public string? CompanyName { get; set; }

        //发布招聘信息的企业统一信用代号
        [AutoValueSet]
        public string? CompanyId { get; set; }

        public Job()
        {
            Id = Guid.NewGuid().ToString();
        }
    }
}
